/**
 *	正则匹配
 *	开发者：雨中磐石
 *	地址：www.rockoa.com
 *	日期：2023-07-19
 */

package com.framerock.baselib;


import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Patter {


	/**
	 * 整个必须是英文
	 * */
	public static Boolean iszgen(String str)
	{
		if(!Rock.isEmpt(str)){
			Pattern pat = Pattern.compile("[a-zA-Z0-9]{1}");
			String str1 = "";
			for(int i=0;i<str.length();i++){
				str1 = str.substring(i, i+1);
				Matcher mat = pat.matcher(str1);
				if(!mat.find())return false;
			}
		}
		return true;
	}

	/**
	 * 是否数字
	 * */
	public static Boolean isnumber(String str)
	{
		if(!Rock.isEmpt(str)){
			str = str.replace(".", "");
			str = str.replace(",", "");
			str = str.replace("-", "");
			Pattern pat = Pattern.compile("[0-9]{1}");
			String str1 = "";
			for(int i=0;i<str.length();i++){
				str1 = str.substring(i, i+1);
				Matcher mat = pat.matcher(str1);
				if(!mat.find())return false;
			}
		}
		return true;
	}
}